<section class="content-header">
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
        <li><a href="#">报表管理</a></li>
        <li class="active">余额汇总</li>
    </ol>
</section>
<!-- Main content -->
<section class="content">
    <div class="jax-box">
        <form id="selectForm" class="form-inline" th:action="@{/report/balanceSummaryList}">

            <div class="form-group">
                <label class="control-label" for="mchId">商户编号：</label>
                <div class="control-inline">
                    <input type="text" id="mchId" name="mchId" class="form-control width-90" />
                </div>
            </div>

            <div class="form-group">
                <label class="control-label" for="tradeType">交易类型:</label>
                <div class="control-inline">
                    <input type="text" id="tradeType" name="tradeType" class="form-control" />
                </div>
            </div>

            <shiro:hasPermission name="report:balanceSummaryList">
                <div class="btn-group" style="text-align:left;">
                    <button type="button" id="btn_query" class="btn btn-info">查询</button>
                    <button type="reset" id="btn_reset" class="btn btn-warning">重置</button>
                </div>
            </shiro:hasPermission>

        </form>
    </div>
    <div class="jax-box jax-box-table">
        <div id="toolbar" class="toolbar btn-group">

        </div>

        <div class="wrapper-content">
            <div class="ibox-content animated fadeInRight">
                <div class="jqGrid_wrapper">
                    <table id="table_list"></table>
                    <div id="pager_list"></div>
                </div>
            </div>
        </div>

    </div>
</section>

<script type="text/javascript">
    $(document).ready(function () {

        var dataGrid = new DataGrid({
            dataGrid: $('#table_list'),
            searchForm: $('#selectForm'),
            dataGridPage: $('#pager_list'),

            rownumbers: true,
            rownumWidth: 60,
            colModel: [
                {
                    header: '商户编号',
                    name: 'mchId',

                    index: 'mchId',
                    editable: false,

                    width: 60,
                    // sorttype: "int",
                    sortable: false,
                    search: false
                },
                {
                    header: '汇总时间',
                    name: 'curdate',

                    index: 'curdate',
                    editable: false,

                    width: 60,
                    // sorttype: "int",
                    sortable: false,
                    search: false
                },{
                    header: '交易类型',
                    name: 'service',
                    index: 'service',
                    editable: false,
                    width: 60,
                    sortable: false,
                    search: false
                },
                {
                    header: '余额',
                    name: 'totalmoney',

                    index: 'totalmoney',
                    editable: false,

                    width: 60,
                    // sorttype: "int",
                    sortable: false,
                    search: false
                }, {
                    header: '收益',
                    name: 'totalprofit',

                    index: 'totalprofit',
                    editable: false,

                    width: 60,
                    // sorttype: "int",
                    sortable: false,
                    search: false
                },{
                    header: '支出',
                    name: 'totalcashout',
                    index: 'totalcashout',
                    editable: false,
                    width: 60,
                    sortable: false,
                    search: false
                },  {
                    header: '未清算金额',
                    name: 'unclearmoney',
                    index: 'unclearmoney',
                    editable: false,
                    width: 60,
                    sortable: false,
                    search: false
                },
                {
                    header: '余额代付金额',
                    name: 'noMoney',
                    index: 'noMoney',
                    editable: false,
                    width: 60,
                    sortable: false,
                    search: false
                },
                {
                    header: '余额代付笔数',
                    name: 'noCount',
                    index: 'noCount',
                    editable: false,
                    width: 60,
                    sortable: false,
                    search: false
                },
                {
                    header: '垫资代付金额',
                    name: 'dzMoney',
                    index: 'dzMoney',
                    editable: false,
                    width: 60,
                    sortable: false,
                    search: false
                },
                {
                    header: '垫资代付笔数',
                    name: 'dzCount',
                    index: 'dzCount',
                    editable: false,
                    width: 60,
                    sortable: false,
                    search: false
                }
            ],
            footerrow : true, //分页上添加一行，用于显示统计信息
            userDataOnFooter : true,
            altRows : true
        })


        $("#btn_query").click(function () {
            $("#table_list").jqGrid('setGridParam', {
                datatype: 'json',
                postData: {
                    mchId: $('input[name=mchId]').val(),
                    curdate: $('input[name=curdate]').val(),
                    service: $('input[name=service]').val(),
                }, // 发送数据
                page: 1
            }).trigger("reloadGrid"); //重新载入
        });
    })
</script>